Skip to content

[#1316] Remove all airdrop code + teardown migration#1319

Merged
realproject7 merged 2 commits into
mainfrom
task/1316-airdrop-teardown
May 28, 2026
Merged

[#1316] Remove all airdrop code + teardown migration#1319
realproject7 merged 2 commits into
mainfrom
task/1316-airdrop-teardown

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

Removes the entire airdrop subsystem in one cohesive PR while keeping every core feature working (story pages, ratings, on-chain indexing, backfill cron, x-stats, profiles, sharing).

This is the CODE portion of the teardown epic #1315. The DB migration is committed but not applied — the operator applies it in #1317.

Changes (per issue spec A1–A13)

  • API routes: deleted src/app/api/airdrop/ (16 route dirs + tests)
  • Frontend: deleted src/app/airdrop/ + src/components/airdrop/; removed StorylineSprintBanner from the story page
  • lib + call sites: removed fire-and-forget awardX(...) calls in ratings, index/storyline, cron/backfill; deleted lib/airdrop/ (incl. twitterapi.ts)
  • Referral: dropped useReferralCode/useReferralCapture/ReferralInput/ReferralCapture; ShareButtons now yields a plain ${appUrl}/story/${id} URL
  • Crons: deleted airdrop-points/airdrop-price/airdrop-weekly; vercel.json keeps backfill (*/5)
  • Legal: removed airdrop sections from privacy/terms (Section 12 removed, following sections renumbered)
  • Contracts: deleted contracts/ + foundry.toml + docs/airdrop-contracts.md; cleaned stale .gitignore Foundry/doc lines
  • Packages: removed siwe, @openzeppelin/merkle-tree, @electric-sql/pglite, nanoid
  • Types: stripped 8 pl_* table blocks + their Pl* aliases from lib/supabase.ts
  • Migration: added supabase/migrations/00042_airdrop_teardown.sql (NOT applied)
  • Version bump 1.41.4 → 1.42.0

Safety invariants honored

Verification

  • npm run lint — clean (after removing leftover untracked Foundry contracts/{out,cache,lib} build artifacts from disk)
  • npm run typecheck — clean
  • npm run build — succeeds; no /airdrop or /api/airdrop/* routes; core routes present
  • npx vitest run — 62/62 pass
  • ✅ Reference sweeps empty: lib/airdrop|components/airdrop|api/airdrop, referral identifiers, removed packages, and broad Airdrop|airdrop|Sprint (src/lib/scripts)

Test plan

  • CI green (lint-and-typecheck + e2e)
  • Browser smoke (reviewer, needs live env): story page renders, share button → plain /story/{id}, ratings submit, profile + x-stats load
  • Confirm migration 00042 is present and NOT applied to prod

Out of scope (operator follow-up)

Closes #1316

🤖 Generated with Claude Code

Removes the entire airdrop subsystem in one cohesive change while keeping
all core features working:
- Delete airdrop API routes, frontend pages/components, lib/airdrop, crons
- Remove fire-and-forget award call sites (ratings, index/storyline, backfill)
- Drop referral hooks/components; simplify ShareButtons to plain story URL
- Remove airdrop sections from privacy/terms; NavBar commented link
- Delete contracts/ (Foundry), foundry.toml, docs/airdrop-contracts.md
- Remove airdrop-only packages (siwe, merkle-tree, pglite, nanoid)
- Strip 8 pl_* table types from lib/supabase.ts; clean stale .gitignore lines
- Add migration 00042_airdrop_teardown.sql (NOT applied; operator applies in #1317)

Safety: keeps TWITTERAPI_IO_KEY + lib/x-stats.ts, backfill cron, and all
story/ratings/profile/sharing features. Version bump 1.41.4 -> 1.42.0.

Closes #1316

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored May 28, 2026 10:24am

Request Review

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The teardown scope is broadly aligned with #1316: the airdrop/referral code paths, crons, packages, and migration are removed/added as requested. However, the PR cannot be approved while required CI is red.

Findings

  • [blocking] Required GitHub checks are failing for this PR.
    • File: CI / PR #1319
    • Details: lint-and-typecheck and e2e both failed on Actions run 26568645986. This violates the issue acceptance criteria requiring npm run lint && npm run build to pass and the reviewer checklist requirement that the build pass.
    • Suggestion: Fix the failing CI jobs or push the missing verification fix, then ping reviewers for re-review once checks are green.

Decision

Requesting changes until CI is green. The code-level teardown/reference sweeps I checked against the PR tree did not show remaining airdrop/referral/package references.

@realproject7

Copy link
Copy Markdown
Owner Author

Review: @re2 — REQUEST CHANGES

Code is correct and complete. Verified against PR head 11abf4c — every acceptance criterion in #1316 is met:

  • A1–A13 all implemented. Path sweep (lib/airdrop|components/airdrop|api/airdrop), broad Airdrop|airdrop|Sprint sweep, removed-package sweep (siwe|merkle-tree|pglite|nanoid), and referral-identifier sweep all return empty across src/lib/scripts.
  • Safety invariants hold: TWITTERAPI_IO_KEY + lib/x-stats.ts retained; backfill cron kept in vercel.json; airdrop crons removed.
  • No orphaned identifiers from the call-site removals: getCachedBlockTimestamp still used (backfill L167/183/200) and blockTimestamp still used (index/storyline L169); Suspense import correctly dropped (no other usage); no dangling Pl* type references.
  • lib/supabase.ts: all 8 pl_* blocks + Pl* aliases removed (231 lines, 0 added).
  • Terms sections renumbered correctly (13→18). Privacy airdrop sections removed.
  • Migration 00042_airdrop_teardown.sql matches spec; not applied (correct — operator does that in [Teardown-B] Archive + apply DB teardown migration #1317).

Blocker — CI is red on npm ci (both lint-and-typecheck and e2e)

npm error `npm ci` can only install packages when your package.json and package-lock.json ... are in sync.
npm error Missing: utf-8-validate@5.0.10 from lock file

The committed package-lock.json dropped the utf-8-validate@5.0.10 entries under:

  • node_modules/jayson/node_modules/utf-8-validate
  • node_modules/@walletconnect/jsonrpc-ws-connection/node_modules/utf-8-validate

Both parents are part of the core wallet/RPC stack (unrelated to the airdrop removal) and are still in the tree. utf-8-validate is an optional native dep of their bundled ws. Your local npm install pruned the optional binding, leaving the lock internally inconsistent, so a clean npm ci (exactly what CI runs) fails at the install step. This is also why your local lint/typecheck/build passed — they reused the existing node_modules and never exercised a clean install.

Fix

Regenerate the lock so those utf-8-validate@5.0.10 entries are retained, then verify with a clean install before pushing — that's the real gate:

npm install            # resync lock with package.json (keep optional deps)
rm -rf node_modules && npm ci   # must pass — this is what CI does

If your environment keeps pruning the optional binding, run npm install --include=optional or restore the two utf-8-validate lock blocks directly. Everything else LGTM — I'll re-approve as soon as npm ci is green.

CI runs Node 20 / npm 10, but the lock was first regenerated in this sandbox
under npm 11 (Node 24), which pruned optional utf-8-validate entries that
npm 10 expects — causing `npm ci` to fail with "Missing: utf-8-validate@5.0.10
from lock file". Regenerated the lock with npm 10.8.2 (matching CI). Verified
`npm ci`, lint, typecheck, test (62/62), and build all pass under Node 20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

Re-review confirms the CI blocker is fixed. The second commit only restores npm-10-compatible optional lockfile entries, and the airdrop teardown remains aligned with #1316.

Findings

  • None.

Decision

Approving. lint-and-typecheck and e2e are green on Actions run 26569051000; PR-tree sweeps are clean for airdrop/referral/package leftovers; backfill cron, lib/x-stats.ts/TWITTERAPI_IO_KEY, plain story share URLs, and migration 00042_airdrop_teardown.sql match the acceptance criteria.

@realproject7

Copy link
Copy Markdown
Owner Author

Re-review: @re2 — APPROVED

CI is now green (lint-and-typecheck + e2e both pass) on head 07e5893.

Verified:

  • The follow-up commit 07e5893 changes only package-lock.json (+31 lines, single file). The restored utf-8-validate@5.0.10 optional-dep entries (under jayson and @walletconnect/jsonrpc-ws-connection) are back — root cause was an npm 11 vs npm 10 optional-dep pruning mismatch, fixed by regenerating under npm 10.
  • Application code is unchanged from 11abf4c, which I already reviewed against every [Teardown-A] Remove all airdrop code + write teardown migration #1316 acceptance criterion (A1–A13, all sweeps empty, safety invariants intact, migration 00042 correct and not applied).

Both approvals in (@re1 + @re2). LGTM to merge.

@realproject7 realproject7 merged commit 684904c into main May 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Teardown-A] Remove all airdrop code + write teardown migration

2 participants